﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BiliBiliCSharpStudy.old {
    struct Student4 {
        public int ID;
        public long Score;
    }
    /**
     * -> 指针操作
     * -> 只能对结构体使用
     */
    class PointerOptDemo {
        public static void demo() {
            unsafe {
                Student4 stu;
                stu.ID = 1;
                stu.Score = 99;
                Console.WriteLine(stu.Score);
                Student4* pStu = &stu; //&: 取地址符号
                pStu->Score = 100;
                Console.WriteLine(stu.Score);
                (*pStu).Score = 88; //*: 取引用符号
                Console.WriteLine(stu.Score);
            }
        }
    }
}
